#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "../libs/communicate/qcommunicate.h"

#include <QMainWindow>

#include <QStatusBar>
#include <QMenuBar>
#include <QMdiArea>
#include <QLabel>

class StyledBar;
class QFuncodeWindow;
class QGroupMissionProgressDialog;
class QStatusWidget;
class QLogTreeWidget;
class QAbstractPage;
class FancyTabWidget;

struct tagMsgInfo
{
    QDateTime       m_date_time;
    QString         m_information;
};

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void    init_menu_bar();
    void    init_menu_action();
protected slots:
    void    add_sub_window(QMdiSubWindow *sub_window);

    void    serial_connect_fast();
    void    serial_connect();
    void    serial_disconnect();

    void    search();

    void    offline();
    void    online();

    void    status_button_clicked(int index,bool check);

    void    about();
    void    setPassWord();
    void    setLog();
    void    setRuntime();

    void    showMachineInfo();
    void    selectMachine();
    void    clearMachine();

    void    showNewVersionDialog();

    void    update_soft();

    void    soft_update();
protected:
    QMenuBar        *m_menu_bar;
    tagSerialConfig m_config;
    QGroupMissionProgressDialog *m_progresss_dialog;
    FancyTabWidget      *m_fancy_tabwidget;
    QList<QAbstractPage*>   m_pages;
};

#endif // MAINWINDOW_H
